package com.example.fillthemapwithtubes.common;

import com.example.fillthemapwithtubes.R;

public final class Constants {

	public static final String KEY_MAP = "_map";

	public static final int UPDATE_TIME = 1024;

	public static final char TYPE_BLANK = '0';
	public static final char TYPE_SOLID = '1';
	public static final char TYPE_LEFT_DOWN = '2';
	public static final char TYPE_RIGHT_DOWN = '3';
	public static final char TYPE_LEFT_TOP = '4';
	public static final char TYPE_RIGHT_TOP = '5';
	public static final char TYPE_NORTH = '6';
	public static final char TYPE_SOUTH = '7';
	public static final char TYPE_WEST = '8';
	public static final char TYPE_EAST = '9';
	public static final char TYPE_HORIZONTAL = 'J';
	public static final char TYPE_VERTICAL = 'Q';
	public static final char TYPE_CROSS = 'K';
	public static final char TYPE_NONE = 'A';

	public static final String KEY_IMAGE = "_image";

	public static final char BLOCK_LINKED = 'Y';
	public static final char BLOCK_UNLINK = 'N';
	public static final char BLOCK_IGNORE = 'I';

	public static final int NO_MAP_ID = -1;
	public static final int NO_ORDER = -1;
	public static final int ORDER_BY_CREATE_TIME_DESC = 0;
	public static final int ORDER_BY_CREATE_TIME_ASC = 1;
	public static final int ORDER_BY_TOTAL_TIME_DESC = 2;
	public static final int ORDER_BY_TOTAL_TIME_ASC = 3;
	public static final int ORDER_BY_TOTAL_USE_DESC = 4;
	public static final int ORDER_BY_TOTAL_USE_ASC = 5;

	public static final int getImageResourceByBlockType(char type) {
		switch (type) {
		case Constants.TYPE_CROSS:
			return R.drawable.icon_cross_dry;
		case Constants.TYPE_EAST:
			return R.drawable.icon_east_dry;
		case Constants.TYPE_HORIZONTAL:
			return R.drawable.icon_horizontal_dry;
		case Constants.TYPE_LEFT_DOWN:
			return R.drawable.icon_left_down_dry;
		case Constants.TYPE_LEFT_TOP:
			return R.drawable.icon_left_top_dry;
		case Constants.TYPE_NORTH:
			return R.drawable.icon_north_dry;
		case Constants.TYPE_RIGHT_DOWN:
			return R.drawable.icon_right_down_dry;
		case Constants.TYPE_RIGHT_TOP:
			return R.drawable.icon_right_top_dry;
		case Constants.TYPE_SOUTH:
			return R.drawable.icon_south_dry;
		case Constants.TYPE_VERTICAL:
			return R.drawable.icon_vertical_dry;
		case Constants.TYPE_WEST:
			return R.drawable.icon_west_dry;
		case Constants.TYPE_SOLID:
			return R.drawable.icon_block;
		default:
			return R.drawable.icon_blank;
		}
	}
}
